<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="../back-common.jsp"%>
<%@ include file="/WEB-INF/pages/common/taglib.jsp"%>


<%@ taglib uri="http://displaytag.sf.net" prefix="display"%>
<script src="<ls:templateResource item='/resources/plugins/My97DatePicker/WdatePicker.js'/>" type="text/javascript"></script>

<%Long offset = (Long)request.getAttribute("offset");%>

    <table class="${tableclass}" style="width: 100%">
    <thead>
    	<tr><th> <strong class="am-text-primary am-text-lg">用户管理</strong> /  用户登录历史</th></tr>
    </thead>
     <tbody><tr><td>
 <div align="left" style="padding: 3px">
<form:form  action="${contextPath}/admin/loginHistory/query" id="form1">
<input type="hidden" id="curPageNO" name="curPageNO" value="${curPageNO}">
			&nbsp;用户名称
			<input class="${inputclass}" type="text" name="userName" id="userName" maxlength="50" value="${login.userName}" size="15"/>
			&nbsp;开始时间
			 <input readonly="readonly"  name="startTime" id="startTime" class="Wdate" type="text" onClick="WdatePicker()" value='<fmt:formatDate value="${login.startTime}" pattern="yyyy-MM-dd"/>' />
			&nbsp;结束时间 
			 <input readonly="readonly" name="endTime" id="endTime" class="Wdate" type="text" onClick="WdatePicker()" value='<fmt:formatDate value="${login.endTime}" pattern="yyyy-MM-dd"/>' />
			<input class="${btnclass}" type="button" onclick="search()" value="搜索" />
	</div>
</form:form>
 </div>
 </td></tr></tbody>
    </table>

	<div align="center">
        <%@ include file="/WEB-INF/pages/common/messages.jsp"%>
    <display:table name="list" requestURI="/admin/loginHistory/query"  id="item"
         export="false"  class="${tableclass}" style="width:100%" sort="external">
      <display:column title="顺序"  class="orderwidth"><%=offset++%></display:column>
      <display:column title="用户名" property="userName"></display:column>
      <display:column title="IP" property="ip"></display:column>
      <display:column title="国家" property="country"></display:column>
      <display:column title="登录时间">
      	<fmt:formatDate value="${item.time}" pattern="yyyy-MM-dd HH:mm"/>
      </display:column>
    </display:table>
        <ls:page pageSize="${pageSize }"  total="${total}" curPageNO="${curPageNO }"  type="default"/>
    </div>
	
	<script language="JavaScript" type="text/javascript">
		function pager(curPageNO){
			document.getElementById("curPageNO").value=curPageNO;
			document.getElementById("form1").submit();
		}
		
		 highlightTableRows("item");  
		 
		 function search(){
		  	$("#form1 #curPageNO").val("1");//只要是搜索,都是从第一页开始查
		  	$("#form1")[0].submit();
		}
</script>

